package com.hs.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hs.entity.dto.Comment;
import com.hs.entity.dto.TeamEmp;
import com.hs.entity.dto.TeamEmp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeamEmpMapper extends BaseMapper<TeamEmp> {
    @Select("<script>" +
            "SELECT tt.*, t.team_name " +
            "FROM team_emp tt " +
            "LEFT JOIN teams t ON tt.team_id = t.id " +
            "<where>" +
            "<if test='ew != null'>${ew.sqlSegment}</if>" +
            "</where>" +
            "</script>")
    List<TeamEmp> selectListWithTeamName(@Param("ew") Wrapper<TeamEmp> queryWrapper);

}
